﻿@model ProductModel
@Html.ValidationSummary(false)
@Html.HiddenFor(model => model.Id)
<div id="product-edit">
    <ul>
        <li @Html.RenderSelectedTabIndex(0, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.Info")
        </li>
        <li @Html.RenderSelectedTabIndex(1, GetSelectedTabIndex())>
            @T("Admin.Common.SEO")
        </li>
        <li @Html.RenderSelectedTabIndex(2, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.Pictures")
        </li>
        <li @Html.RenderSelectedTabIndex(3, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.Categories")
        </li>
        <li @Html.RenderSelectedTabIndex(4, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.Manufacturers")
        </li>
        <li @Html.RenderSelectedTabIndex(5, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.SpecificationAttributes")
        </li>
        <li @Html.RenderSelectedTabIndex(6, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.ProductVariantAttributes")
        </li>
        <li @Html.RenderSelectedTabIndex(7, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.TierPrices")
        </li>
        <li @Html.RenderSelectedTabIndex(8, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.Discounts")
        </li>
        <li @Html.RenderSelectedTabIndex(9, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.Acl")
        </li>
        <li @Html.RenderSelectedTabIndex(10, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.Stores")
        </li>
        <li @Html.RenderSelectedTabIndex(11, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.RelatedProducts")
        </li>
        <li @Html.RenderSelectedTabIndex(12, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.CrossSells")
        </li>
        <li @Html.RenderSelectedTabIndex(13, GetSelectedTabIndex())>
            @T("Admin.Catalog.Products.AssociatedProducts")
        </li>
        @if (Model.Id > 0)
        {
            <li @Html.RenderSelectedTabIndex(14, GetSelectedTabIndex())>
                @T("Admin.Catalog.Products.PurchasedWithOrders")
            </li>
        }
    </ul>
    <div>
        @TabInfo()
    </div>
    <div>
        @TabSeo()
    </div>
    <div>
        @TabPictures()
    </div>
    <div>
        @TabCategories()
    </div>
    <div>
        @TabManufacturers()
    </div>
    <div>
        @TabSpecificationAttributes()
    </div>
    <div>
        @TabProductAttributes()
    </div>
    <div>
        @TabTierPrices()
    </div>
    <div>
        @TabDiscounts()
    </div>
    <div>
        @TabAcl()
    </div>
    <div>
        @TabStores()
    </div>
    <div>
        @TabRelatedProducts()
    </div>
    <div>
        @TabCrossSells()
    </div>
    <div>
        @TabAssociatedProducts()
    </div>
    @if (Model.Id > 0)
    {
        <div>
            @TabPurchasedWithOrders()
        </div>
    }
</div>
<script>
    $(document).ready(function () {
        $("#product-edit").kendoTabStrip({
            animation: {
                open: {
                    effects: "fadeIn"
                }
            },
            select: tabstrip_on_tab_select
        });
    });
</script>

@{
    //custom tabs
    var eventMessage = new AdminTabStripCreated(this.Html, "product-edit");
    EngineContext.Current.Resolve<IEventPublisher>().Publish(eventMessage);
    foreach (var eventBlock in eventMessage.BlocksToRender)
    {
        @eventBlock
    }
}

@*save selected tab index*@
<input type="hidden" id="selected-tab-index" name="selected-tab-index" value="@(GetSelectedTabIndex())">

@helper TabInfo()
{ 
    @Html.Partial("_CreateOrUpdate.Info", Model)
}
@helper TabSeo()
{
    @Html.Partial("_CreateOrUpdate.SEO", Model)
}
@helper TabCategories()
{
    @Html.Partial("_CreateOrUpdate.Categories", Model)
}
@helper TabManufacturers()
{
    @Html.Partial("_CreateOrUpdate.Manufacturers", Model)
}
@helper TabPictures()
{
    @Html.Partial("_CreateOrUpdate.Pictures", Model)
}
@helper TabSpecificationAttributes()
{
    @Html.Partial("_CreateOrUpdate.SpecificationAttributes", Model)
}
@helper TabAcl()
{
    @Html.Partial("_CreateOrUpdate.Acl", Model)
}
@helper TabStores()
{
    @Html.Partial("_CreateOrUpdate.Stores", Model)
}

@helper TabTierPrices()
{
    @Html.Partial("_CreateOrUpdate.TierPrices", Model)
}
@helper TabProductAttributes()
{
    @Html.Partial("_CreateOrUpdate.ProductAttributes", Model)
}
@helper TabDiscounts()
{
    @Html.Partial("_CreateOrUpdate.Discounts", Model)
}
@helper TabRelatedProducts()
{
    @Html.Partial("_CreateOrUpdate.RelatedProducts", Model)
}
@helper TabCrossSells()
{
    @Html.Partial("_CreateOrUpdate.CrossSells", Model)
}
@helper TabAssociatedProducts()
{
    @Html.Partial("_CreateOrUpdate.AssociatedProducts", Model)
}
@helper TabPurchasedWithOrders()
{
    @Html.Partial("_CreateOrUpdate.PurchasedWithOrders", Model)
}

